# 输入输出
# 输出
# print('hello')
# 格式化字符串
# a = 10
# print(f"a = {a}")
# f-string
# f表示format，往{}嵌入变量或表达式
from pickle import FALSE

# 输入
# num = input('请输入一个整数: ')
# print(f'输入的数字是 {num}')
# # input的返回值是str类型
# print(type(num))

# 所以两个输入是字符串拼接
# a = input()
# b = input()
# print(f'a+b={a+b}')
# 类型转换int() 同理str() float()
# a = input()
# b = input()
# a = int(a)
# b = int(b)
# print(f'a+b={a+b}')

# 算数运算符
# ** * / + -
result = (1+2)*3
print(result)

# 0不能作为除数
print(1/2)
print(7%3)
print(2**5)
print(2**0.5)

# //地板除法-取整数
print(7/2)
print(7//2)

# 关系运算符
# >= > <= < == !=
a = 10
b = 20
print(a > b)
print(a >= b)
print(a <= b)
print(a < b)
print(a == b)
print(a != b)
# 字符串也能比较

# 逻辑操作符
# and or not(逻辑取反)等价于!
y = 100
print(y)
# a = True
# b = False
# print(a and b)
# print(a or b)
a = 10
b = 20
c = 30
# 两种写法
print(a < b < c)
print(a < b and b < c)
p = True
print(not p)
print(p)

# 变量赋值
q, w = 1000, 2000
print(q)
print(w)

# 使用多元赋值，一步完成交换
q, w = w, q
print(q)
print(w)

# 复合运算—— += -= *= /= %= //= **=
# 注意：不支持前置++/--和后置++/-- 操作
a = 0
a += 1
print(a)
